<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: Event API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__events.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Event API</div></div>
</div><!--header-->
<div class="contents">

<p>API functions for event delivery from lower-layer library functions.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga58978fec0cb0a118e2e47b3eb9b5efdc" id="r_ga58978fec0cb0a118e2e47b3eb9b5efdc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga58978fec0cb0a118e2e47b3eb9b5efdc">COAP_EVENT_DTLS_CLOSED</a>&#160;&#160;&#160;0x0000</td></tr>
<tr class="memdesc:ga58978fec0cb0a118e2e47b3eb9b5efdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">(D)TLS events for COAP_PROTO_DTLS and COAP_PROTO_TLS  <br /></td></tr>
<tr class="separator:ga58978fec0cb0a118e2e47b3eb9b5efdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeedad13a6a9e652948097bb1f8290229" id="r_gaeedad13a6a9e652948097bb1f8290229"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaeedad13a6a9e652948097bb1f8290229">COAP_EVENT_DTLS_CONNECTED</a>&#160;&#160;&#160;0x01DE</td></tr>
<tr class="separator:gaeedad13a6a9e652948097bb1f8290229"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga367c24eff1326e0e3f8bd1d7dcd5363a" id="r_ga367c24eff1326e0e3f8bd1d7dcd5363a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga367c24eff1326e0e3f8bd1d7dcd5363a">COAP_EVENT_DTLS_RENEGOTIATE</a>&#160;&#160;&#160;0x01DF</td></tr>
<tr class="separator:ga367c24eff1326e0e3f8bd1d7dcd5363a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4b7987047870eb07d52a9bb7a04b04ad" id="r_ga4b7987047870eb07d52a9bb7a04b04ad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga4b7987047870eb07d52a9bb7a04b04ad">COAP_EVENT_DTLS_ERROR</a>&#160;&#160;&#160;0x0200</td></tr>
<tr class="separator:ga4b7987047870eb07d52a9bb7a04b04ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2a1235d6d66e20095721a60c5ccdf84" id="r_gaf2a1235d6d66e20095721a60c5ccdf84"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaf2a1235d6d66e20095721a60c5ccdf84">COAP_EVENT_TCP_CONNECTED</a>&#160;&#160;&#160;0x1001</td></tr>
<tr class="memdesc:gaf2a1235d6d66e20095721a60c5ccdf84"><td class="mdescLeft">&#160;</td><td class="mdescRight">TCP events for COAP_PROTO_TCP and COAP_PROTO_TLS.  <br /></td></tr>
<tr class="separator:gaf2a1235d6d66e20095721a60c5ccdf84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c9db860dda8985faa989922fccafc4a" id="r_ga4c9db860dda8985faa989922fccafc4a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga4c9db860dda8985faa989922fccafc4a">COAP_EVENT_TCP_CLOSED</a>&#160;&#160;&#160;0x1002</td></tr>
<tr class="separator:ga4c9db860dda8985faa989922fccafc4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa06f99fe2908c1d1f14e114ebaa13bc6" id="r_gaa06f99fe2908c1d1f14e114ebaa13bc6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaa06f99fe2908c1d1f14e114ebaa13bc6">COAP_EVENT_TCP_FAILED</a>&#160;&#160;&#160;0x1003</td></tr>
<tr class="separator:gaa06f99fe2908c1d1f14e114ebaa13bc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga75fd68f962ebce49338db56c9bb7bec1" id="r_ga75fd68f962ebce49338db56c9bb7bec1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga75fd68f962ebce49338db56c9bb7bec1">COAP_EVENT_SESSION_CONNECTED</a>&#160;&#160;&#160;0x2001</td></tr>
<tr class="memdesc:ga75fd68f962ebce49338db56c9bb7bec1"><td class="mdescLeft">&#160;</td><td class="mdescRight">CSM exchange events for reliable protocols only.  <br /></td></tr>
<tr class="separator:ga75fd68f962ebce49338db56c9bb7bec1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecbcf934fd89dd203cbbea4f768e41fc" id="r_gaecbcf934fd89dd203cbbea4f768e41fc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaecbcf934fd89dd203cbbea4f768e41fc">COAP_EVENT_SESSION_CLOSED</a>&#160;&#160;&#160;0x2002</td></tr>
<tr class="separator:gaecbcf934fd89dd203cbbea4f768e41fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84fedccf8f1ae24163454156a7932229" id="r_ga84fedccf8f1ae24163454156a7932229"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga84fedccf8f1ae24163454156a7932229">COAP_EVENT_SESSION_FAILED</a>&#160;&#160;&#160;0x2003</td></tr>
<tr class="separator:ga84fedccf8f1ae24163454156a7932229"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga75a08ceb9a855937288ac3996656c872" id="r_ga75a08ceb9a855937288ac3996656c872"><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a></td></tr>
<tr class="memdesc:ga75a08ceb9a855937288ac3996656c872"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scalar type to represent different events, e.g.  <br /></td></tr>
<tr class="separator:ga75a08ceb9a855937288ac3996656c872"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga47e52d9f286d209a75c5e2ce34af67ac" id="r_ga47e52d9f286d209a75c5e2ce34af67ac"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a>) (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *, <a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a> event, struct <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session)</td></tr>
<tr class="memdesc:ga47e52d9f286d209a75c5e2ce34af67ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type for event handler functions that can be registered with a CoAP context using the unction <a class="el" href="group__events.html#ga29f689b91842169c70871f47852d1d92" title="Registers the function hnd as callback for events from the given CoAP context context.">coap_set_event_handler()</a>.  <br /></td></tr>
<tr class="separator:ga47e52d9f286d209a75c5e2ce34af67ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaff5f3d7ce262ca60c48498b4d4d9938b" id="r_gaff5f3d7ce262ca60c48498b4d4d9938b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaff5f3d7ce262ca60c48498b4d4d9938b">coap_register_event_handler</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a> hnd)</td></tr>
<tr class="memdesc:gaff5f3d7ce262ca60c48498b4d4d9938b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the function <code>hnd</code> as callback for events from the given CoAP context <code>context</code>.  <br /></td></tr>
<tr class="separator:gaff5f3d7ce262ca60c48498b4d4d9938b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29f689b91842169c70871f47852d1d92" id="r_ga29f689b91842169c70871f47852d1d92"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga29f689b91842169c70871f47852d1d92">coap_set_event_handler</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a> hnd)</td></tr>
<tr class="memdesc:ga29f689b91842169c70871f47852d1d92"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the function <code>hnd</code> as callback for events from the given CoAP context <code>context</code>.  <br /></td></tr>
<tr class="separator:ga29f689b91842169c70871f47852d1d92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga71fb9f4722d1355e28d3928fe5c56af1" id="r_ga71fb9f4722d1355e28d3928fe5c56af1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga71fb9f4722d1355e28d3928fe5c56af1">coap_clear_event_handler</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:ga71fb9f4722d1355e28d3928fe5c56af1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the event handler registered with <code>context</code>.  <br /></td></tr>
<tr class="separator:ga71fb9f4722d1355e28d3928fe5c56af1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>API functions for event delivery from lower-layer library functions. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga58978fec0cb0a118e2e47b3eb9b5efdc" name="ga58978fec0cb0a118e2e47b3eb9b5efdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga58978fec0cb0a118e2e47b3eb9b5efdc">&#9670;&#160;</a></span>COAP_EVENT_DTLS_CLOSED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_DTLS_CLOSED&#160;&#160;&#160;0x0000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>(D)TLS events for COAP_PROTO_DTLS and COAP_PROTO_TLS </p>

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00033">33</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="gaeedad13a6a9e652948097bb1f8290229" name="gaeedad13a6a9e652948097bb1f8290229"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeedad13a6a9e652948097bb1f8290229">&#9670;&#160;</a></span>COAP_EVENT_DTLS_CONNECTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_DTLS_CONNECTED&#160;&#160;&#160;0x01DE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00034">34</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga4b7987047870eb07d52a9bb7a04b04ad" name="ga4b7987047870eb07d52a9bb7a04b04ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4b7987047870eb07d52a9bb7a04b04ad">&#9670;&#160;</a></span>COAP_EVENT_DTLS_ERROR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_DTLS_ERROR&#160;&#160;&#160;0x0200</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00036">36</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga367c24eff1326e0e3f8bd1d7dcd5363a" name="ga367c24eff1326e0e3f8bd1d7dcd5363a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga367c24eff1326e0e3f8bd1d7dcd5363a">&#9670;&#160;</a></span>COAP_EVENT_DTLS_RENEGOTIATE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_DTLS_RENEGOTIATE&#160;&#160;&#160;0x01DF</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00035">35</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="gaecbcf934fd89dd203cbbea4f768e41fc" name="gaecbcf934fd89dd203cbbea4f768e41fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecbcf934fd89dd203cbbea4f768e41fc">&#9670;&#160;</a></span>COAP_EVENT_SESSION_CLOSED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_SESSION_CLOSED&#160;&#160;&#160;0x2002</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00049">49</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga75fd68f962ebce49338db56c9bb7bec1" name="ga75fd68f962ebce49338db56c9bb7bec1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga75fd68f962ebce49338db56c9bb7bec1">&#9670;&#160;</a></span>COAP_EVENT_SESSION_CONNECTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_SESSION_CONNECTED&#160;&#160;&#160;0x2001</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>CSM exchange events for reliable protocols only. </p>

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00048">48</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga84fedccf8f1ae24163454156a7932229" name="ga84fedccf8f1ae24163454156a7932229"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84fedccf8f1ae24163454156a7932229">&#9670;&#160;</a></span>COAP_EVENT_SESSION_FAILED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_SESSION_FAILED&#160;&#160;&#160;0x2003</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00050">50</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga4c9db860dda8985faa989922fccafc4a" name="ga4c9db860dda8985faa989922fccafc4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4c9db860dda8985faa989922fccafc4a">&#9670;&#160;</a></span>COAP_EVENT_TCP_CLOSED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_TCP_CLOSED&#160;&#160;&#160;0x1002</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00042">42</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="gaf2a1235d6d66e20095721a60c5ccdf84" name="gaf2a1235d6d66e20095721a60c5ccdf84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf2a1235d6d66e20095721a60c5ccdf84">&#9670;&#160;</a></span>COAP_EVENT_TCP_CONNECTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_TCP_CONNECTED&#160;&#160;&#160;0x1001</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TCP events for COAP_PROTO_TCP and COAP_PROTO_TLS. </p>

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00041">41</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="gaa06f99fe2908c1d1f14e114ebaa13bc6" name="gaa06f99fe2908c1d1f14e114ebaa13bc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa06f99fe2908c1d1f14e114ebaa13bc6">&#9670;&#160;</a></span>COAP_EVENT_TCP_FAILED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_EVENT_TCP_FAILED&#160;&#160;&#160;0x1003</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00043">43</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga47e52d9f286d209a75c5e2ce34af67ac" name="ga47e52d9f286d209a75c5e2ce34af67ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga47e52d9f286d209a75c5e2ce34af67ac">&#9670;&#160;</a></span>coap_event_handler_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* coap_event_handler_t) (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *, <a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a> event, struct <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Type for event handler functions that can be registered with a CoAP context using the unction <a class="el" href="group__events.html#ga29f689b91842169c70871f47852d1d92" title="Registers the function hnd as callback for events from the given CoAP context context.">coap_set_event_handler()</a>. </p>
<p>When called by the library, the first argument will be the <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object where the handler function has been registered. The second argument is the event type that may be complemented by event-specific data passed as the third argument. </p>

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00060">60</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<a id="ga75a08ceb9a855937288ac3996656c872" name="ga75a08ceb9a855937288ac3996656c872"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga75a08ceb9a855937288ac3996656c872">&#9670;&#160;</a></span>coap_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef unsigned int <a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Scalar type to represent different events, e.g. </p>
<p>DTLS events or retransmission timeouts. </p>

<p class="definition">Definition at line <a class="el" href="coap__event_8h_source.html#l00028">28</a> of file <a class="el" href="coap__event_8h_source.html">coap_event.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga71fb9f4722d1355e28d3928fe5c56af1" name="ga71fb9f4722d1355e28d3928fe5c56af1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga71fb9f4722d1355e28d3928fe5c56af1">&#9670;&#160;</a></span>coap_clear_event_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> void coap_clear_event_handler </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the event handler registered with <code>context</code>. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__events.html#gaff5f3d7ce262ca60c48498b4d4d9938b" title="Registers the function hnd as callback for events from the given CoAP context context.">coap_register_event_handler()</a> instead with NULL for hnd.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context whose event handler is to be removed. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="coap__event_8c_source.html#l00030">30</a> of file <a class="el" href="coap__event_8c_source.html">coap_event.c</a>.</p>

</div>
</div>
<a id="gaff5f3d7ce262ca60c48498b4d4d9938b" name="gaff5f3d7ce262ca60c48498b4d4d9938b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff5f3d7ce262ca60c48498b4d4d9938b">&#9670;&#160;</a></span>coap_register_event_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_register_event_handler </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a>&#160;</td>
          <td class="paramname"><em>hnd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the function <code>hnd</code> as callback for events from the given CoAP context <code>context</code>. </p>
<p>Any event handler that has previously been registered with <code>context</code> will be overwritten by this operation.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to register the event handler with. </td></tr>
    <tr><td class="paramname">hnd</td><td>The event handler to be registered. <code>NULL</code> if to be de-registered. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="coap__event_8c_source.html#l00018">18</a> of file <a class="el" href="coap__event_8c_source.html">coap_event.c</a>.</p>

</div>
</div>
<a id="ga29f689b91842169c70871f47852d1d92" name="ga29f689b91842169c70871f47852d1d92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga29f689b91842169c70871f47852d1d92">&#9670;&#160;</a></span>coap_set_event_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a> void coap_set_event_handler </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a>&#160;</td>
          <td class="paramname"><em>hnd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the function <code>hnd</code> as callback for events from the given CoAP context <code>context</code>. </p>
<p>Any event handler that has previously been registered with <code>context</code> will be overwritten by this operation.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>Use <a class="el" href="group__events.html#gaff5f3d7ce262ca60c48498b4d4d9938b" title="Registers the function hnd as callback for events from the given CoAP context context.">coap_register_event_handler()</a> instead.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to register the event handler with. </td></tr>
    <tr><td class="paramname">hnd</td><td>The event handler to be registered. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="coap__event_8c_source.html#l00024">24</a> of file <a class="el" href="coap__event_8c_source.html">coap_event.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
